<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"  isELIgnored="false"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<div>
<h1>抱歉,出错啦!</h1>
<p class="error">${message}</p>
<p class="detail">${errorStack}</p>
<p class="jump">
<b id="wait">${timeSeconds}</b> 秒后页面将自动跳转
</p>
<div>
    <a id="href" id="btn-now" href='javascript:history.go(-1)'>立即跳转</a> 
    <button id="btn-stop" type="button" onclick="stop()">停止跳转</button> 
</div>
</div>
<script type="text/javascript">
(function(){
	var redirect='<c:url value="${redirect}"/>';
 var wait = document.getElementById('wait'),href = document.getElementById('href').href;
 if(redirect!='')
	 href=redirect;
 var interval = setInterval(function(){
     	var time = --wait.innerHTML;
     	if(time <= 0) {
     			location.href = href;
     		clearInterval(interval);
     	};
     }, 1000);
  window.stop = function (){
            clearInterval(interval);
 }
 })();
</script>
</body>
</html>